#include<stdio.h>
void  num ( int  m, int k, int  a[] );
int main()
{	 	         	 
    int  i, m, n, a[1000];
    printf("Please enter two integers m and n:\n");
    scanf("%d,%d", &m, &n);
    num(m, n, a);
    for ( i = 0; i < n; i++ )
    {	 	         	 
        printf("%d ", a[i]);
    }
    return 0;
}	 	         	 
void num (int m, int k, int a[])   
{	 	         	 
    int i, j, sum, flag;       

    for (i = m + 1, sum = 0; sum < k; i++)  //3
    {	 	         	 
        flag = 1;                 //1
        
        for (j = 2; j < i; j++)    //2
        {	 	         	 
            if (i % j == 0)   //2
            {	 	         	 
                flag = 0;     //1
            }
        }
        if (flag)           //1
        {	 	         	 
            a[sum++] = i;  //2
        }
    }
}